rm(list = ls())

## 

library(tidyverse)
library(rdrobust)
library(rddensity)

## Get municipal data

bt <- readRDS('data/data_federal.rds') %>%
  filter(!is.na(treated)) %>% 
  filter(year == 2013)

## Figure A.1: Density of the running variable (population in 2009) ----

p1 <- ggplot(bt %>% filter(between(pop_dec_09, 5000, 15000)), 
             aes(x = pop_dec_09)) + 
  geom_histogram(fill = 'white',
                 color = 'black', breaks = seq(5000, 15000, 500)) +
  geom_vline(xintercept = 10000, linetype = 'dashed') +
  theme_bw() +
  xlab('Pre-census population') +
  ylab('Frequency') + xlim(5000, 15000)
p1

